package com.hbnu.controller;

import com.hbnu.pojo.User;
import com.hbnu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("getUser")
    public List<User> getUser() {
        return userService.findUser();
    }

    @RequestMapping(value = "/param", method = RequestMethod.GET)
    public String Param(@RequestParam(value = "username") String username) {
        return "hello :: " + username;
    }

    @RequestMapping("/doUserPage")
    public String doUserPage(){
        return "use";
    }
}
